package com.pm.web.controller.buglist;


import com.alibaba.fastjson2.JSONObject;
import com.pm.buglist.domain.WavieOrder;
import com.pm.buglist.service.WavieOrderService;
import com.pm.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * waive单申请记录表 前端控制器
 * </p>
 *
 * @author wwm
 * @since 2024-06-19
 */
@RestController
@RequestMapping("/business/wavie-order")
public class WavieOrderController {

    @Resource
    private WavieOrderService wavieOrderService;

    /**
     * 研发申请废弃
     * @param wavieOrder
     * @return
     */
    @PostMapping("/approveWaive/{bId}")
    public AjaxResult approveWaive(@PathVariable("bId") Long bId, @RequestBody WavieOrder wavieOrder){
        wavieOrder.setBId(bId);
        return wavieOrderService.approverWaive(wavieOrder);
    }

    /**
     * 获取waive bug对应的项目列表
     * @return
     */
    @GetMapping("/getWaiveBugProject")
    public AjaxResult getWaiveBugProject(){
        List<JSONObject> list = wavieOrderService.findProjectListByWaiveOrder();
        return AjaxResult.success(list);
    }

}

